﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Frame.Lib.Data;

namespace Forum.Entity.Post
{
    public partial class ForumPictureInfo : EntityBase
    {
        public override string GetTableName()
        {
            return "ForumPicture";
        }
        public override string GetInsertSql()
        {
            return "insert into ForumPicture ( [ID], [Name], [TopicID], [PostID], [Path], [MemberID], [MemberName], [Extension], [Size], [InputTime]) values ( @ID, @Name, @TopicID, @PostID, @Path, @MemberID, @MemberName, @Extension, @Size, @InputTime)";
        }
        public override string GetUpdateSql()
        {
            return "update ForumPicture set  [ID] = @ID, [Name] = @Name, [TopicID] = @TopicID, [PostID] = @PostID, [Path] = @Path, [MemberID] = @MemberID, [MemberName] = @MemberName, [Extension] = @Extension, [Size] = @Size, [InputTime] = @InputTime where ID = @ID";
        }
        /// <summary>
        /// PK
        /// </summary>
        public Int32 ID
        {
            get;
            set;
        }
        /// <summary>
        /// 文件名
        /// </summary>
        public String Name
        {
            get;
            set;
        }
        /// <summary>
        /// FK
        /// </summary>
        public Int32 TopicID
        {
            get;
            set;
        }
        /// <summary>
        /// FK
        /// </summary>
        public Int32 PostID
        {
            get;
            set;
        }
        /// <summary>
        /// Web路径
        /// </summary>
        public String Path
        {
            get;
            set;
        }
        /// <summary>
        /// 会员ID
        /// </summary>
        public Int32 MemberID
        {
            get;
            set;
        }
        /// <summary>
        /// 会员名
        /// </summary>
        public String MemberName
        {
            get;
            set;
        }
        /// <summary>
        /// 扩展名
        /// </summary>
        public String Extension
        {
            get;
            set;
        }
        /// <summary>
        /// 大小
        /// </summary>
        public Int32 Size
        {
            get;
            set;
        }
        /// <summary>
        /// 上传时间
        /// </summary>
        public DateTime InputTime
        {
            get;
            set;
        }
        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Int32)value;
                    break;
                case "name":
                    this.Name = (String)value;
                    break;
                case "topicid":
                    this.TopicID = (Int32)value;
                    break;
                case "postid":
                    this.PostID = (Int32)value;
                    break;
                case "path":
                    this.Path = (String)value;
                    break;
                case "memberid":
                    this.MemberID = (Int32)value;
                    break;
                case "membername":
                    this.MemberName = (String)value;
                    break;
                case "extension":
                    this.Extension = (String)value;
                    break;
                case "size":
                    this.Size = (Int32)value;
                    break;
                case "inputtime":
                    this.InputTime = (DateTime)value;
                    break;
            }
        }
        public override object GetValue(string key)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    return this.ID;
                case "name":
                    return this.Name;
                case "topicid":
                    return this.TopicID;
                case "postid":
                    return this.PostID;
                case "path":
                    return this.Path;
                case "memberid":
                    return this.MemberID;
                case "membername":
                    return this.MemberName;
                case "extension":
                    return this.Extension;
                case "size":
                    return this.Size;
                case "inputtime":
                    return this.InputTime;
                default:
                    return null;
            }
        }
    }


}
